This article Reprinted from: http://blog.csdn.net/jcodeer/article/details/1811339
'''Tkinter: frame '''# Frame is a rectangular area on the screen. It is mostly used as a container to layout the form.'''1. Create a frame '''#-*-Coding: cp936 -*-From tkinter import *Root = TK
Town Field Poem:The Pure Heart sentiment wisdom language, does not have the world name and the benefit. Learn water under the hundred rivers, give up arrogant slow meaning.Learn to have a small return to feed root, willing to cast a conscience blog. Sincere in this writing experience, willing to see the text to inspire.——————————————————————————————————————————CodeFrom Tkinter import *root=tk () #创建一个框架, responding to event
Town Field Poem:The Pure Heart sentiment wisdom language, does not have the world name and the benefit. Learn water under the hundred rivers, give up arrogant slow meaning.Learn to have a small return to feed root, willing to cast a conscience blog. Sincere in this writing experience, willing to see the text to inspire.——————————————————————————————————————————CodeFrom Tkinter import *root=tk () #创建一个框架, in this framework responds to event
Problem background: When the interface needs to display more content, need to use scroll bar ScrollBar, Official document said ScrollBar can only with the following controls (canvas, entry, ListBox, text) combined. But if I want ScrollBar to be combined with frame.
The solution is to put the frame inside the canvas (such as filling the entire canvas), canvas with ScrollBar, so scrolling canvas is equivalen
Use the Tkinter module in Python to create a GUI program instance, pythontkinter
Use the Tkinter module to create a simple GUI program.
Tkinter's Widgets include buttons, Canvas, Checkbutton, Entry, Frame, Label, Listbox, Menu, Menubutton, Message, Radiobutton, Scales, Scrollbar, TEXT, and Toplevel.
Example:Copy codeThe Code is as follows:# This program displays
):
Alt: When you press the Alt button
Any: indicates that Any type of buttons are pressed. For example,
Control: When the Ctrl key is pressed
Double: When two subsequent events are triggered consecutively, for example,
Lock: When uppercase letters are opened
Shift: When you press Shift
Triple: When three subsequent events are triggered
Event object:
Note: When Tkinter calls back a predefined function, it will call it with an Evnet object. Commonly
PythonGUI programming-tkinter, pythongui-tkinter
Graphical User Interface (G raphical U ser I nterface, GUI) Programming
The versions below Python2.0 are called Tkinter, and Python3.0 is renamed tkinter.
Tkinter module: Add Tk to ApplicationSo what do you need to do to make
Python GUI with Tkinter-1-IntroductionThe link above is the first link to a Python tkinter video series. Although English is not good, but, the program still can understand (according to do), so can not find the Chinese video to see these English video is also possible.Here are the exercises I'm looking at in the video, which can be run under python2.7.001:hello,world:From
Tkinter is the installation of Python on its own GUI library, Cross-platform, although simple, I see a lot of people on the Internet to learn this GUI library is not interesting, now so many good GUI library, but I think there is a reasonable, there is always a reason for learning. I would like to take this GUI library to learn a simple GUI interface design and python knowledge of object-oriented programming.
Tkin
Tkinter is a built-in GUI library for python installation. It is cross-platform. Although it is simple, I have seen many people on the internet saying that it is boring to learn this GUI library. Now there are so many good GUI Libraries, however, I think the existence is reasonable and there is always a reason for learning. I want to use this GUI library to learn simple GUI interface design and Python knowledge about object-oriented programming.
Hello, Again.
When you write larger programs, it's usually a good idea to wrap your code up into one or more classes. The following example is adapted to the "Hello World" program in Matt Conway's A tkinter life preserver (dead link).It's a good idea to wrap code into one or more classes when writing large applications. The following example is adapted from the "Hello World" in Matt Conway's A Tkinter life
The previous article we learned about Python CGI programming, this article we will introduce
Python GUI Programming (Tkinter)and attached
Python tkinter Tutorial.Python provides a library of multiple graphical development interfaces, several common Python GUI libraries are as follows:
Tkinter: The Tkinter module (TK i
black window?
The written program runs with the execution file pythonw.exe with w. No window will be generated.Py is an open-source software and does not advocate exe packaging.You only need to put the python interpreter and code together to unpack the package on the client.You only need to set up a shortcutPython source code. pyOrPythonw source code. pyYou can.There is tkinter in python27. How can I install it?
I checked that
80 lines of code use Python + tkinter to implement a calculator, 80 lines of tkinter
If you don't talk about it, go straight to the topic. We recommend that you repeat the code and try out the code reuse, use the string method, and dynamically create components. Then, you can supplement and give full play to this framework.
Select any Python development environment, create a program file named tkinter_Calc
used when the content exceeds a visual area, such as a list box ...
Text
Text control; for displaying multiple lines of text
TopLevel
A container control that provides a separate dialog box, similar to a frame
Spinbox
Input controls, similar to entry, but can specify input range values
Panedwindow
Panedwindow is a window layout-managed plug-in that can contain one or more chi
Python study note _ 02: Use Tkinter to connect to the MySQL database for login and registration. _ 02 tkinter
1. Establish an environment1.1 install Python1.2 create a MySQL Environment1.3 install MySQLdb2. Specific implementation2.1 login interface2.2 registration page2.3 Specific implementation code
1
Environment Construction1.1
Python Installation
Python environment: Python2.7.14 and 64-bit
For detailed
Swing that has learned java may know that when creating a window, the upper left corner of the window is
As shown in:
In python, the upper left corner of the window generated by the tkinter module is:
As shown in:
So we need to replace the icon marked with Tk with our own icon. What should we do?
Check the running effect:
Tkinter * = {: root = root. title (root. geometry (root. iconbitmap
extension-C/TCL language implementation of the TK plugin-xlib
Python itself is cross-platform, TCL/TK Graphics library is cross-platform, so tkinter can also cross platform ...
For Python programmers, it is not necessary to have a detailed understanding of the graphics library TCL/TK, of course, if you can understand that the Tkinter programming is a help group.
Just as Java programmers don't need to under
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.